Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

od.1: add "raw" and "byte" to document description #1525

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

concussious
Copy link
Contributor

@concussious concussious commented Nov 13, 2024

Use case: User is looking for a tool to view raw bytes:

apropos -s1 raw
apropos -s1 byte

Both do not show our excellent, mature tooling for this.

Proposition: They can be added cleanly and elegantly to the document description of od(1), and the resulting title still looks good even in MANWIDTH 59. Since this is a straightforward manual search bug fix for tooling in 14.2, I would like to humbly ask that this is MFC to the beta, that to increase the likelihood that the new generation of people who will starting in 14.2 have a greater chance of learning our culture.

Should I do the same for hd(1)? There isn't room to do this in hd(1) without line wrapping.

@jlduran
Copy link
Member

jlduran commented Nov 13, 2024

I'm starting to notice a trend of apropos search-driven pull requests 😅 perhaps what we need is a smarter searching algorithm.

I do not fully understand these concepts:

What is a "raw octal"?
What is an "ASCII byte dump"?

@concussious
Copy link
Contributor Author

concussious commented Nov 13, 2024

I'm starting to notice a trend of apropos search-driven pull requests

Yes, that is one of my central goals, to increase manual accessibility, to increase appreciation for traditional BSD doc culture so that people keep investing in it. I am here, investing in it. We need technical writers thinking thoughtfully about the doc. That is why doc has it's own commit bits.

perhaps what we need is a smarter searching algorithm.

In the last 50 years many people have regressed on that hill, and we have seen astronomical documentation proliferation as a result. I like our simple algorithm. It scales down really well, really good at excluding incorrect information, and works really well if the Nd is written thoughtfully. Please, don't try to touch the apropos algorithm.

I do not fully understand these concepts:

Alright, how do you feel about:

od(1) - octal, decimal, hex, ASCII raw byte dump

@jlduran
Copy link
Member

jlduran commented Nov 13, 2024

I may not be the most appropriate reviewer for this change, as my intention is not to sound too harsh:

What is a "cooked"/"non-raw" byte? The way I understand it, it is already raw, so to speak?

Regarding the "bytes", that would require a major change, indicating the number of bytes each representation has for each flag:

Representation # of bytes
octal
decimal (signed/unsigned)
hex
ASCII

Maybe using the Open Group Specification as a guide (https://pubs.opengroup.org/onlinepubs/9799919799/utilities/od.html)?

@concussious
Copy link
Contributor Author

I may not be the most appropriate reviewer for this change, as my intention is not to sound too harsh:

When it comes to doc, anyone who is sincere and interested is a good person.

I show my drafts to completely unrelated people and ask them, "hey, we're trying to make some doc on an obscure engineering topic more clear, just reading this, what do you think this does? Does this seem clearer than this one?"

What is a "cooked"/"non-raw" byte?

Rendered? "Raw" is a very common way of describing these types of outputs, look at endless questions on stack overflow, recent discussion on other reviews, etc.

I don't understand your third paragraph. What do you mean?

Although thinking about it, raw satisfies the search problem, and bytes is imprecise.

@jlduran
Copy link
Member

jlduran commented Nov 13, 2024

I don't understand your third paragraph. What do you mean?

For example:

Current:
-d Output unsigned decimal shorts. Equivalent to -t u2.

With bytes:
-d Output unsigned decimal shorts (two-byte units). Equivalent to -t u2.

And so on.

@concussious
Copy link
Contributor Author

concussious commented Nov 13, 2024

Damn, so bytes was perfectly accurate and helpful. I'll write it back in 3 hours when I get home.

Many people recommend tools like xxd to do this in
exactly the same way. Reinforce the culture of the
BSD cathedral by increasing visibility of the base
tooling that is portable, mature, well-documented,
and equivelant in functionality. Also, tag spdx :)

MFC after:	3 days
@jlduran
Copy link
Member

jlduran commented Nov 14, 2024

I can't seem to find a coherent sentence that includes both words that can be used in the description.

@concussious
Copy link
Contributor Author

concussious commented Nov 14, 2024

Well then, unless you're objecting (which I respect and defend your right to do), this one will have to wait. I find it a solid compromise of coherence and visibility. "octal, decimal, hex, ASCII dump" is not a "coherent" sentence either, but it's quite an understandable "one line about what it does". You already said that calling it raw is not coherent, and byte is not coherent because it's two bytes sometimes. I do really appreciate the non-review comments and conscious thought on this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants